var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (im.getServerName().equals("BMS单机") && im.getServerName().equals("BMS至尊体验服") && !im.getServerName().equals("BMS至尊")) {
        im.playerMessage(1, " 使用环境异常，请还原服务端配置。");
        im.dispose();
        return
    }
    if (status == 0 && d == 0) {
        im.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            im.askYesNo("你想马上使用#i2631612:# #b#e#t2631612:##k#n吗？", 4, 9010010)
        } else {
            if (status === a++) {
                im.sendNormalTalk("奖励已经发放，去确认一下背包吧！", 0, 9010010, false, false);
                im.gainItem(2631612, -1);
                im.gainItem(3700620, 1)
            } else {
                if (status === a++) {
                    im.dispose()
                }
            }
        }
    }
};